home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / userbox / publicdomain / delitracker_ii / files / smpl.doc < prev    next >
Text File  |  1994-01-24  |  4KB  |  92 lines

  1.  
  2.                                    SMPL
  3.                   A dynamic huffman with delta precoding
  4.                                 Version 1.0
  5.                       Copyright 1993 by Jorma Oksanen
  6.  
  7.  
  8.  
  9.                             License/Disclaimer
  10.                             ------------------
  11.  
  12.   This  library may be freely distributed with the XPK compression package,
  13. as  long  as it is kept in its original, complete, and unmodified form.  It
  14. may  not  be  distributed  by itself or in a commercial package of any kind
  15. without my written permission.
  16.  
  17.   This  program  is  distributed  in  the  hope that it will be useful, but
  18. WITHOUT  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  19. or FITNESS FOR A PARTICULAR PURPOSE.
  20.  
  21.                                 Decription
  22.                                 ----------
  23.  
  24.   SMPL  is  a  XPK  sublibrary  implementing  dynamic  huffman  coding over
  25. variations  of  datastream.   If  that sound too complicated, I suggest you
  26. read  docs  for DLTA and HUFF, in that order.  In fact, DLTA was made to be
  27. used as preprocessor for other XPK packers.
  28.  
  29.   Then  why did I code SMPL?  Think this:  how many music programs you know
  30. that  support  XPK ?  Yes, I know I can always use XFH so I can pack all my
  31. data,  but  if I have first fed data thru DLTA and then another compressor,
  32. then  XFH  only  decompresses  the  latter.  So I still need XPK supporting
  33. program to pack my samples efficiently.
  34.  
  35.   SMPL  overcomes this by including DLTA coding into same library.  I chose
  36. to  use huffman coding for actual packing as it seemed to give best average
  37. compression.   I  snatched the huffman code from xpkHUFF.library (Copyright
  38. 1992 by M.Zimmermann) and tweaked it a bit for faster (de)compression.
  39.  
  40.   So,  how  well  it  compresses samples?  I took 1.7 MB of samples and ran
  41. them thru several packers.  The compression ratios I got:
  42.  
  43.     HUFF    17%        DLTA+HUFF    27%
  44.     IMPL    21%        DLTA+IMPL    23%
  45.     NUKE    20%        DLTA+NUKE    23%
  46.     SHRI    29%        DLTA+SHRI    34%
  47.     SMPL    30%        DLTA+SMPL    25%
  48.  
  49.   From  above table you should see why I chose huffman for compression.  It
  50. gains  most  from  delta encoding.  But if you surely want best compression
  51. ratios regardless of time used then go for DLTA+SHRI.
  52.  
  53.   Some samples were packed better with simple HUFF without delta precoding.
  54. If I find a way to determine output size from frequency table (ie.  without
  55. building huffman tree) I will add non-delta packing to SMPL.
  56.  
  57.   I  tested DLTA+SMPL mainly to see if there would be any use for recursive
  58. delta,  but  less  than  100K of all data packed marginally better when fed
  59. thru double delta.
  60.  
  61.   Three  percent  difference  between  SMPL  and  DLTA+HUFF  comes from two
  62. things:
  63.  1) xpkmaster.library adds some bytes to DLTA coded files
  64.  2) I store huffman tree in more compact way
  65.  
  66.  
  67.     Following  is  a  table briefly listing some comparative statistics for
  68. SMPL.   These were generated by xBench on the standard XPK benchmark system
  69. (A3000/25 with SCRAM, using the AmigaVision executable as data).  Note that
  70. memory needs don't include xpkmaster.library's buffers.
  71.  
  72. Method   Packing   Unpacking   Packing   Unpacking   Compression
  73.          Memory     Memory      Speed      Speed        Ratio
  74. ------   -------   ---------   -------   ---------   -----------
  75.  SMPL       14K        7K      151 K/s     354 K/s        6.7%
  76.  
  77.  
  78.                               Version History
  79.                               ---------------
  80.  
  81. 1.00    First public release.
  82.  
  83.  
  84.                               Contact Address
  85.                               ---------------
  86.  
  87.     Jorma Oksanen
  88.     Ratastie 5 A 3
  89.     14200 TURENKI
  90.     FINLAND
  91.  
  92.